package antrace;

import processing.core.PImage;

public class SplashView implements InterfaceView {

	private PImage splashImage;
	
	private int startTime;

	public SplashView() {
		splashImage = AntRace.midlet.loadImage("/images/splashscreen_antrace.png");
		
		startTime = (int)AntRace.midlet.getCentralTime();
	}
	
	public void draw() {
		int duration = (int)AntRace.midlet.getCentralTime() - startTime;
		
		if(duration > 40)
			AntRace.viewManager.currentView = AntRace.menu;
		
		AntRace.midlet.image(splashImage,0,0);
	}

	public void keyPressed(int keyCode) {
		AntRace.viewManager.currentView = AntRace.menu;
	}
	
	public void keyReleased(int keyCode) {
		// Här behövs inte göras nåt.
	}
	
}